from django.db import models

# Create your models here.
from django.contrib.auth.models import AbstractUser    #用户自定义模型类 AbstractUser


class MyUser(AbstractUser):
    phone = models.CharField(max_length=16,null=True,verbose_name="手机号")
    pic = models.CharField(max_length=128,null=True,verbose_name="头像")
    address = models.CharField(max_length=32,null=True,verbose_name="地址")

    def __str__(self):
        return self.username


class APPUID(models.Model):
    app={
        (1,"QQ"),
        (2,"微信"),
        (3,"支付宝"),
        (4,"微博"),
    }
    uid = models.CharField(max_length=64)
    from_app = models.IntegerField(choices=app)
    users = models.ForeignKey(MyUser,on_delete=models.CASCADE,null=True)
